﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IOBusiness;
using System.Data;
using System.Text;

namespace Indochinaodyssey.UserControl.Slide
{
    public partial class ucHotToursSlide : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            lblHotTours.Text = SliderHotTours();
        }

        private string SliderHotTours()
        {
            try
            {
                string sql = "Select ID,TieuDe,Url from tblHinhAnh where Loai=4";
                clsBSDungChung bs = new clsBSDungChung();
                DataTable tbImage = new DataTable();
                tbImage = bs.GetDataTableSQL(sql, "Cruises");
                StringBuilder menu = new StringBuilder();
                menu.Append("<div id=\"gallery\">");
               
                for (int i = 0; i < tbImage.Rows.Count; i++)
                {
                    if (i==0)
                    {
                        menu.Append("<a href=\"#\" class=\"show\">");
                    }
                    else
                    {
                        menu.Append("<a href=\"#\">");
                    }
                    menu.Append("<img src=\"images/Hinhanh/" + tbImage.Rows[i][2] + "\" alt=\"\" alt=\"\" title=\"\" width=\"385px\" height=\"174px\" rel=\"<h3></h3>" + tbImage.Rows[i][1] + "\"/></a>");
                    

                }
                menu.Append("<div class=\"caption\"><div class=\"content\"></div></div>");
                menu.Append("</div> ");
                return menu.ToString();
            }
            catch
            {
                throw;
            }
        }
    }
}